<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       #box1{
            width: 400px;
            height: 400px;
            position: relative;
        }

        #box1 img{
            position: absolute;
            width: 100%;
            height: 100%;
        }

        #box01 img:nth-child(1){
            opacity: 0;
        }
    </style>
</head>
<body>
    <input type="button" value="变装" id="btnGo">
    <div id="box1">
         <img src="../images/02.png" alt="">
         <img src="../images/01.png" alt="">
    </div>
    <script src="../../js/tools.js"></script>
    <script>
        let btnGo = document.getElementById('btnGo')
        let imgDoms = document.querySelectorAll('#box1 img')
        btnGo.onclick= function(){
            fadeInOut(imgDoms[0],imgDoms[1],2000)
        }
    </script>
</body>
</html>